package com.dx.wx.controller;

import cn.binarywang.wx.miniapp.api.WxMaService;
import com.dx.wx.service.DxHomeService;
import com.dx.wx.util.DxUtil;
import com.ejlchina.data.Array;
import com.ejlchina.data.Mapper;
import com.yf.annotation.IgnoreAuth;
import com.yf.response.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/dx")
public class ApiDxController {

    @GetMapping("/info")
    @IgnoreAuth
    public R info(){
        return R.ok().putExtra("token",DxUtil.CorpAccessToken).putExtra("corpId",DxUtil.CorpId);
    }

    @Resource
    private DxHomeService dxHomeService;


    @GetMapping("/home")
    @IgnoreAuth
    public R home(String appId){
        Array array = dxHomeService.bannerList(appId);

        return R.ok(array.toString());
    }

}
